﻿@model NK.Mvc3.Models.Sale
@{
    ViewBag.Title = "Sale";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.json-2.3.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.formatCurrency-1.4.0.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/Customize/saleclient.js")" type="text/javascript"></script>

<h2>
    Sale</h2>
<a href="" value></a>
<p>
    <div id="beginSale">
        @Ajax.ActionLink("Begin Sale", "InsertSaleDetail", new AjaxOptions
   {
       HttpMethod = "GET",
       UpdateTargetId = "gridinsert",
       InsertionMode = InsertionMode.Replace,
       OnSuccess = "finishedLoadInsertSaleDetail"
   }) | @Html.ActionLink("List Sale Today","Index")
    </div>
    <div id="divActions" class="hidden">
        @*@Ajax.ActionLink("Finish","InsertSaleDetail",new AjaxOptions{HttpMethod = "GET",
                                                                         UpdateTargetId = "gridinsert",
                                                                         InsertionMode = InsertionMode.Replace,
                                                                         OnSuccess = "finishedLoadInsertSaleDetail"
        })*@ <a href="#finish" id="finishInserting" urlaction="@Html.Raw(Url.Action("InsertSaleDetail"))" 
                urlredirect="@Html.Raw(Url.Action("SaleSummary"))">Finish</a> | <a href="#cancel" id="cancelInserting">
            Cancel</a>
    </div>
</p>
<div id="insertSaleDetail">
</div>
<input type="hidden" value="" id="hdSaleId" />
<p>
    <fieldset id="salefieldset" class="hidden">
        <legend>Sale Details</legend>
        <div class="grid">
            <div class="gridheader">
                <div class="gridrow">
                    <div class="gridcell">
                        Barcode</div>
                    <div class="gridcell text">
                        POS Description</div>
                    <div class="gridcell num">
                        Quantity</div>
                    <div class="gridcell money">
                        Cost</div>
                    <div class="gridcell money">
                        Total</div>
                    <div class="gridcell action">
                    </div>
                </div>
            </div>
            <div class="gridinsert">
                <div class="gridrow" id="gridinsert">
                </div>
            </div>
            <div class="gridbody" id="gridbody">
            </div>
        </div>
    </fieldset>
</p>
